package com.senlingspace.common.enums;

/**
 *
 *
 * @author wangliang
 */
public enum UserType {

    SYSTEM("00","系统用户"),
    OPERATE("02","运营方"),
    SHOP("03","门店"),
    INVESTOR("04","投资人"),
    COPYRIGHT("05","版权方");

    private final String code;
    private final String description;

    UserType(String code,String description) {
        this.code = code;
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public String getCode() {
        return code;
    }

    public static OrderType fromCode(int code) {
        for (OrderType type : OrderType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }

}
